package com.wangzh;


import com.wangzh.config.ServerConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.Arrays;

@SpringBootApplication
@EnableCaching
@EnableScheduling
public class SpringbootApplication {

    public static void main(String[] args) {
        System.out.println(Arrays.toString(args));

//        String[] arg = new String[1];
//        arg[0]="--server.port=8082";
//        SpringApplication.run(SpringbootApplication.class,arg);
        ConfigurableApplicationContext run = SpringApplication.run(SpringbootApplication.class);
        ServerConfig bean = run.getBean(ServerConfig.class);
        System.out.println(bean);
    }
}
